<%-- 
    Document   : BillBookTours
    Created on : Nov 1, 2011, 11:08:36 PM
    Author     : MrKoi
--%>

<%@page import="DAL.TourBookingBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%
String username="";
if(session.getAttribute("User")!=null) {
    username=(String)session.getAttribute("User");
    TourBookingBean btour=new TourBookingBean();
    Collection coll=btour.getBillBookTour(username);
    request.setAttribute("btour",coll);
} else {
    out.println("<script>alert('Please login before view bill of tours !');window.location='index.jsp';</script>");
    
}

%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
         <style type="text/css">
            
        </style>
    </head>
    <body>
        
        <center>   
            
            <span style="font-size: 20px;color: #343434;">Bills of booking tour</span>
            <table cellspacing="3" border="1"  align="center" style="border:1px solid #ccc; font-family:Arial, Helvetica, sans-serif; font-size: 11px;text-align:center;" width="100%">                
                    <tr bgcolor="#CCCCCC">                
                        
                        <td><b>User name</b></td>
                        <td><b>Tour name</b></td>   
                        <td><b>Start date</b></td>           
                        <td><b>End date</b></td>                
                        <td><b>Date booking</b></td>
                        <td><b>Total of guests</b></td>                      
                        <td><b>Total money (USD)</b></td>                    
                        
                        <td><b>View more</b></td>
                        <td><b>Cancel tour</b></td>
                    </tr>
                
                
                    
                    
                    <c:forEach items="${btour}" var="tp">        
                        <tr>              	
                            
                            <td>${tp.userName}</td>                   
                            <td  >${tp.typeTour}</td>                         
                            <td>${tp.startDate}</td>
                            <td  >${tp.endDate}</td>
                            <td>${tp.dateBooking}</td>
                            <td  >${tp.totalOfGuest}</td>
                            <td> <f:formatNumber value="${tp.totalMoney}" pattern="$#,###"/></td>                         
                            
                            <td  >
                                <form action="ControllerViewBillT" method="post">
                                    <input name="tourIdB" value="${tp.tourId}" type="hidden"/>
                                    <input name="typeTourB" value="${tp.typeTour}" type="hidden"/>
                                    <input name="numberOfChildB" value="${tp.numberOfChild}" type="hidden"/>
                                    <input name="numberOfAdultB" value="${tp.numberOfAdult}" type="hidden"/>
                                    <input name="totalOfGuestB" value="${tp.totalOfGuest}" type="hidden"/>
                                    <input name="totalMoneyB" value="${tp.totalMoney}" type="hidden"/>
                                    <input name="startDateB" value="${tp.startDate}" type="hidden"/>
                                    <input name="endDateB" value="${tp.endDate}" type="hidden"/>
                                    <input name="dateBookingB" value="${tp.dateBooking}" type="hidden"/>
                                    <input name="cashB" value="${tp.cash}" type="hidden"/>                                  
                                    
                                    <input type="submit" value="View more" name="submit" style="background-image:url(skinImgTuor/btnSmall.jpg);color:white;width:70px;font-size:12px;border:none;"/>
                                    
                                </form>
                            </td>
                            <td>                                
                                <form action="ControllerConfirmCanTour" method="post">
                                    <input name="CBookingid" type="hidden" value="${tp.bookingId}"/>
                                    <input name="CtourId" type="hidden" value="${tp.tourId}"/>
                                    <input name="CtypeTour" value="${tp.typeTour}" type="hidden"/> 
                                    <input name="CnumberOfChild" value="${tp.numberOfChild}" type="hidden"/>
                                    <input name="CnumberOfAdult" value="${tp.numberOfAdult}" type="hidden"/>
                                    <input name="CtotalOfGuest" value="${tp.totalOfGuest}" type="hidden"/>
                                    <input name="Ctotalmoney" type="hidden" value="${tp.totalMoney}"/>
                                    <input name="Cstartdate" type="hidden" value="${tp.startDate}"/>
                                    <input name="CendDate" value="${tp.endDate}" type="hidden"/>
                                    <input name="CdateBooking" value="${tp.dateBooking}" type="hidden"/>
                                    <input name="Ccash" value="${tp.cash}" type="hidden"/>                                 
                                    
                                    <input type="submit" value="Cancel" name="submit" onClick="return confirm('Are you sure to cancel?')" style="background-image:url(skinImgTuor/btnSmall.jpg);color:white;width:50px;font-size:12px;border:none;"/>                                
                                </form>
                            </td>                            
                        </tr>                        
                    </c:forEach>     
                    
                
            </table>            
            <br/>            
            <a href="index.jsp">Back home Page</a>
        </center>    
        
    </body>
</html>